package com.gxgeek;

import groovy.lang.GroovyClassLoader;
import org.springframework.stereotype.Component;

/**
 * @author gaoxing
 * @create 2018-06-08 下午3:39
 */
@Component
public class ScriptUtils {

    public static Class loadGroovyScript(String script,String beanName){
        GroovyClassLoader classLoader = new GroovyClassLoader(Thread.currentThread().getContextClassLoader());
        Class groovyClass = classLoader.parseClass(script,beanName);
        return groovyClass;
    }
}
